package city.spring.modules.material.service;

import city.spring.modules.material.entity.MaterialinventoryMaterialExtEntity;
import city.spring.modules.material.vo.MaterialinventoryMaterialVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Service：物资盘点计划与物资关系表
 *
 * @author 谢金婷
 * @date 2020-07-27 09:44:32
 */
public interface MaterialinventoryMaterialExtService extends IService<MaterialinventoryMaterialExtEntity> {
    String CACHE_NAME = "materialinventory_material_ext";

    /**
     * 业务处理：保存一个 <strong>物资盘点计划与物资关系表</strong>
     *
     * @param entity 物资盘点计划与物资关系表
     */
    void saveMaterialinventoryMaterialExt(MaterialinventoryMaterialExtEntity entity);

    /**
     * 业务处理：修改一个 <strong>物资盘点计划与物资关系表</strong>
     *
     * @param entity 物资盘点计划与物资关系表
     */
    void updateMaterialinventoryMaterialExt(MaterialinventoryMaterialExtEntity entity);

    /**
     * 业务处理：删除一个 <strong>物资盘点计划与物资关系表</strong>
     *
     * @param primaryKey 主键ID
     */
    void deleteMaterialinventoryMaterialExt(String primaryKey);

    /**
     * 业务处理：删除多个 <strong>物资盘点计划与物资关系表</strong>
     *
     * @param primaryKeys 主键ID列表
     */
    void deleteMaterialinventoryMaterialExt(List<String> primaryKeys);

    /**
     * 获取损益值不为空和不为0的盘点物资记录 分页展示
     *
     * @param pageable
     * @return
     */
    IPage<MaterialinventoryMaterialExtEntity> getInventoryWarehousingAndDelivery(Pageable pageable);

    IPage<MaterialinventoryMaterialVO> listPage(Page<? extends MaterialinventoryMaterialExtEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends MaterialinventoryMaterialExtEntity> wrapper);

    /**
     * 盘点校正
     * @param entity
     */
    void inventoryCorrection(MaterialinventoryMaterialExtEntity entity);
}